package com.punch.course.controller;

import com.punch.common.model.Result;
import com.punch.common.vo.course.goods.SimpleGoodsVO;
import com.punch.course.service.GoodsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 商品管理
 *
 * @author wujj
 * @version 1.0.0
 * @since 2020/11/19 10:51
 */
@RestController
@Api(value = "GoodsController", tags = "商品管理Controller")
public class GoodsController {

    @Resource
    private GoodsService goodsService;
//
//    /**
//     * 条件分页查询商品列表
//     *
//     * @param queryInfo 查询信息
//     * @return PageInfo
//     */
//    @GetMapping(value = "/goods", produces = "application/json; charset=utf-8")
//    @ApiOperation(value = "条件分页查询商品列表", notes = "条件分页查询商品列表", produces = "application/json")
//    public Result<PageInfo<GoodsPageVO>> listGoods(@ModelAttribute GoodsQueryInfo queryInfo) {
//        return Result.succeed(goodsService.listGoods(queryInfo));
//    }

    /**
     * 课程下选择教具/教材
     *
     * @return List<SimpleGoodsVO>
     */
    @GetMapping(value = "/goods/simple", produces = "application/json; charset=utf-8")
    @ApiOperation(value = "课程下选择教具/教材", notes = "课程下选择教具/教材", produces = "application/json")
    public Result<List<SimpleGoodsVO>> listSimpleGoods() {
        return Result.succeed(goodsService.listSimpleGoods());
    }

}
